Multi-factor Model

Statistical Risk Model

Criteria Meet Specification

Fit PCA

The function fit_pca fits the PCA model with returns.

Factor Betas

The function factor_betas gets the factor betas from the PCA model.

Factor Returns

The function factor_returns gets the factor returns from the PCA model.

Factor Covariance Matrix

The function factor_cov_matrix gets the factor covariance matrix.

Idiosyncratic Variance Matrix

The function idiosyncratic_var_matrix gets the idiosyncratic variance matrix.

Idiosyncratic variance Vector

The function idiosyncratic_var_vector gets the idiosyncratic variance vector.

Predict using the Risk Model

The function predict_portfolio_risk gets the predicted portfolio risk.

Create Alpha Factors

Criteria Meet Specification

Mean Reversion 5 Day Sector Neutral Factor

The function mean_reversion_5day_sector_neutral generates the mean reversion 5 day sector neutral factor.

Mean Reversion 5 Day Sector Neutral Smoothed Factor

The function mean_reversion_5day_sector_neutral_smoothed generates the mean reversion 5 day sector neutral smoothed factor.

Evaluate Alpha Factors

Criteria Meet Specification

Sharpe Ratio of the Alphas

The function sharpe_ratio gets the sharpe ratio for each factor for the entire period.

What do you think would happen if we smooth the momentum factor?

The student correctly mentions what would happened if you smooth the momentum factor and why.

Optimal Portfolio Constrained by Risk Model

Criteria Meet Specification

Objective Function

The function OptimalHoldings._get_obj returns the correct objective function.

Constraints Function

The function OptimalHoldings._get_constraints returns the correct list of constraints.

Optimize with a Regularization Parameter

The function OptimalHoldingsRegualization._get_obj returns the correct objective function.

Optimize with a Strict Factor Constraints and Target Weighting

The function OptimalHoldingsStrictFactor._get_obj returns the correct objective function.